<?php


namespace app\common\model;


class PointsLog extends Base
{
    protected $table = "maniac_points_log";
    protected $createTime = "created_at";
    protected $updateTime = "updated_at";
    protected $autoWriteTimestamp = true;         // 自动写入时间戳

    //获取用户信息
    public function getMemberInfoAttr($value,$data){
        return Members::where("id",$data['member_id'])->field('id,username,mobile')->find();
    }
    //获取操作人员信息
    public function getUserInfoAttr($value,$data){
        return Users::where("id",$data['user_id'])->field('id,username,real_name,stores_id')->append(['stores_name'])->find();
    }
}